import Viewer from './core/Viewer'

export default class {
  declare public width: number
  declare public height: number
  declare public dom: HTMLElement
  declare public app: Viewer

  constructor(dom: HTMLElement, options?: unknown) {
    this.dom = dom
    const { width, height } = dom.getBoundingClientRect()

    this.width = width
    this.height = height
  }
  init() {
    this.app = new Viewer(this.dom, { width: this.width, height: this.height })
    this.app.init()
  }
  destroy() {
    this.app?.destroy()
  }
}